{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "aec473b825fb4ef0bf92e48e8f483bed",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Plot(antialias=3, axes=['x', 'y', 'z'], background_color=16777215, fps_meter=False, grid=[-0.9848077297210693,…"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\"\"\"Find the vertices that are connected to a specific vertex in a mesh.\"\"\"\n",
    "\n",
    "from vtkplotter import *\n",
    "\n",
    "s = Sphere(c=\"r\", res=10).wireframe()\n",
    "\n",
    "index = 12 #pick vertex nr 12\n",
    "\n",
    "vtxs = s.connectedVertices(index, returnIds=False)\n",
    "\n",
    "apt  = Point(s.getPoint(index), r=7, c=\"lg\")\n",
    "cpts = Points(vtxs, c=\"blue\")\n",
    "\n",
    "show(s, apt, cpts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
